import 'package:flutter_test/flutter_test.dart';
import 'package:giraffe/giraffe.dart';
import 'package:giraffe/giraffe_platform_interface.dart';
import 'package:giraffe/giraffe_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockGiraffePlatform
    with MockPlatformInterfaceMixin
    implements GiraffePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final GiraffePlatform initialPlatform = GiraffePlatform.instance;

  test('$MethodChannelGiraffe is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelGiraffe>());
  });

  test('getPlatformVersion', () async {
    Giraffe giraffePlugin = Giraffe();
    MockGiraffePlatform fakePlatform = MockGiraffePlatform();
    GiraffePlatform.instance = fakePlatform;

    expect(await giraffePlugin.getPlatformVersion(), '42');
  });
}
